import Vue from 'vue'
const component2 = {
  template: `<div><input type="text" @input="changeValue"></div>`,
  model: {
    props: 'val',
    event: 'input1'
  },
  methods: {
    changeValue (event) {
      this.$emit('input1', event.target.value)
    }
  }
}

new Vue({
  el: '#app',
  components: {
    component2
  },
  data () {
    return {
      val: '123'
    }
  },
  watch: {
    val (newValue, oldValue) {
      console.log(newValue, oldValue)
    }
  },
  template: `<div><component2 v-model="val" ></component2></div>`
})
